package com.java.bean;

import java.sql.Timestamp;
import java.util.Objects;

public class Admin {
    private Integer id;
    private String name;
    private String password;
    private String ip;
    private Timestamp logintime;
    private Timestamp createtime;
    private String phone;

    public Admin() {}

    public Admin(String name, String password, String ip, Timestamp logintime) {
        this.name = name;
        this.password = password;
        this.ip = ip;
        this.logintime = logintime;
    }

    public Admin(Integer id, String name, String password, String ip, Timestamp logintime, Timestamp createtime) {
        this.id = id;
        this.name = name;
        this.password = password;
        this.ip = ip;
        this.logintime = logintime;
        this.createtime = createtime;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Integer id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getIp() {
        return ip;
    }

    public void setIp(String ip) {
        this.ip = ip;
    }

    public Timestamp getLogintime() {
        return logintime;
    }

    public void setLogintime(Timestamp logintime) {
        this.logintime = logintime;
    }

    public Timestamp getCreatetime() {
        return createtime;
    }

    public void setCreatetime(Timestamp createtime) {
        this.createtime = createtime;
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        Admin admin = (Admin) o;
        return Objects.equals(id, admin.id) && Objects.equals(name, admin.name) && Objects.equals(password, admin.password) && Objects.equals(ip, admin.ip) && Objects.equals(logintime, admin.logintime) && Objects.equals(createtime, admin.createtime) && Objects.equals(phone, admin.phone);
    }

    @Override
    public int hashCode() {
        return Objects.hash(id, name, password, ip, logintime, createtime, phone);
    }

    @Override
    public String toString() {
        return "Admin{" +
                "id=" + id +
                ", name='" + name + '\'' +
                ", password='" + password + '\'' +
                ", ip='" + ip + '\'' +
                ", logintime=" + logintime +
                ", createtime=" + createtime +
                ", phone='" + phone + '\'' +
                '}';
    }
}
